package com.atguigu.gulimall.search.config;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author THX
 * @since 2020/6/28 17:14
 */
@Configuration
public class ElasticSearchConfig {
    public static final RequestOptions COMMON_OPTIONS = RequestOptions.DEFAULT;

    @Bean
    public RestHighLevelClient getClient() {
        RestHighLevelClient client =
            new RestHighLevelClient(RestClient.builder(new HttpHost("192.168.33.10", 9200, "http")));
        return client;

    }

}
